#pragma once

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>

typedef int BTDataType;
typedef struct BinaryTreeNode
{
    struct BinaryTreeNode* left;
    struct BinaryTreeNode* right;
    BTDataType data;
}BTNode;

//       1
//    2        3
//  4      5       6

//创建二叉树
BTNode* CreateBTree();

//前序遍历
void PrevOrder(BTNode* root);

//中序遍历
void InOrder(BTNode* root);

//后序遍历
void PostOrder(BTNode* root);

//节点总数
int BTreeSize(BTNode* root);

//叶子总数
int BTreeLeafSize(BTNode* root);

//第K层节点的个数
int BTreeKLevelSize(BTNode* root, int k);

//树的深度`高度
int BTreeDepth(BTNode* root);

//查找值为x的节点
BTNode* BTreeFind(BTNode* root, BTDataType x);

//单值二叉树
bool isUnivalTree(BTNode* root);

//相同的树
bool isSameTree(BTNode* p, BTNode* q);

//对称二叉树
bool isSymmetric(BTNode* p, BTNode* q);

//前序遍历`输出型参数
int* prevOrderTraversal(BTNode* root, int* returnSize);

//另一棵树的子树
bool isSubTree(BTNode* root, BTNode* subRoot);

//销毁二叉树
void BtreeDestroy(BTNode* root);

//层序遍历
void LevelOrder(BTNode* root);

//判断完全二叉树
bool BTreeComplete(BTNode* root);






